<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/lib/layui-v2.5.4/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<style>
    #currentTableId + .layui-table-view .layui-table-body tbody > tr > td {
        padding: 0;
    }

    #currentTableId + .layui-table-view .layui-table-body tbody > tr > td > .layui-table-cell {
        height: 60px;
        line-height: 60px;
    }

    .tdImg {
        width: 50px;
        height: 50px;
        max-width: none;
        cursor: zoom-in;
    }

    .layui-table-view {
        margin: 0;
    }

</style>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="layui-elem-field layuimini-search">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">接待客服</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <a class="layui-btn" lay-submit="" lay-filter="data-search-btn">搜索</a>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
            <a class="layui-btn  layui-btn-xs layui-btn-warm" lay-event="savePassword">修改密码</a>
            <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
        </script>
    </div>
</div>




<script src="/static/lib/layui-v2.5.4/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table','layer'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
        var layer = layui.layer;

        // 点击图片放大
        $(document).off('click.tbImg').on('click.tbImg', '[tb-img]', function () {
            layer.photos({photos: {data: [{src: $(this).attr('src')}]}, shade: .1, closeBtn: true});
        });
        table.render({
            elem: '#currentTableId',
            url: '/serviceList',
            limit:20,
            limits:[20,30,50],
            cellMinWidth: 100,
            response: {
                statusCode: 1000 //规定成功的状态码，默认：0
            },
            cols: [[
                {field: 'vsid', width: 80, title: 'ID', align: 'center'},
                {field: 'visitor_id', width: 200, title: '游客id'},
                {field: 'visitor_name', title: '游客名称',align: 'center'},
                {field: 'visitor_ip', title: 'IP',align: 'center'},
                {field: 'kefu_name', title: '接待客服',align: 'center'},
                {field: 'start_date', title: '开始时间', minWidth: 150,align: 'center'},
                {field: 'end_date', title: '结束时间', minWidth: 150,align: 'center'},

            ]],
            page: true
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            //执行搜索重载
            table.reload('currentTableId', {
                page: {
                    curr: 1
                }
                , where: data.field
            }, 'data');

            return false;
        });

    });

</script>
<script>

</script>

</body>
</html>
